package com.jh3502.vivo.function.contact;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jh3502.vivo.R;
import com.jh3502.vivo.base.BaseActivity;
import com.jh3502.vivo.base.BasePresenter;

import butterknife.BindView;

import static com.jh3502.vivo.R.id.fragment_container;
import static com.jh3502.vivo.R.id.toolbar_title;

/**
 * @author harisucici
 * @version 2018/12/5 08:52
 * name
 * todo
 * @email harisucici@gmail.com
 */
public class ContactActivity extends BaseActivity {
    @BindView(toolbar_title)
    TextView toolbarTitle;
    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(fragment_container)
    LinearLayout fragmentContainer;


    @Override
    public BasePresenter initPresenter() {
        return null;
    }

    @Override
    protected int setViewId() {
        return R.layout.activity_contact;
    }

    @Override
    protected void initView() {
        toolbar.setTitle("");
        toolbarTitle.setText("人员列表");
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        ContactFragment contactFragment = new ContactFragment();
        Bundle bundle = new Bundle();
        bundle.putBoolean("hidebutton", false);
        Bundle b = getIntent().getExtras();
        if (b == null) {
            bundle.putBoolean("singlechosen", false);
            bundle.putBoolean("weituo", false);
        } else {
            bundle.putBoolean("singlechosen", b.getBoolean("singlechosen"));
            bundle.putBoolean("weituo", b.getBoolean("weituo"));
        }

        contactFragment.setArguments(bundle);
        getSupportFragmentManager().beginTransaction().
                replace(R.id.fragment_container, contactFragment).commit();
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void doOnDestroy() {

    }

    @Override
    protected void doOnResume() {

    }

    @Override
    protected void doOnSaveInstanceState(Bundle savedInstanceState) {

    }


    @Override
    public void responseError(int code, String msg) {

    }

}
